package com.example.studykotlin.kotlin_actual_combat.KotlinDocument

import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import androidx.recyclerview.widget.DividerItemDecoration
import androidx.recyclerview.widget.LinearLayoutManager
import com.alibaba.android.arouter.facade.annotation.Route
import com.example.studykotlin.Path
import com.example.studykotlin.R
import com.example.studykotlin.databinding.ActivityKotlinDocumentBinding
import com.example.studykotlin.kotlin_actual_combat.BaseActivity.BaseActivity
import com.example.studykotlin.kotlin_actual_combat.KotlinDocument.Adapter.PageJumpAdapter

@Route(path = Path.KotlinDocument)
class KotlinDocumentActivity : BaseActivity() {
    private lateinit var binding: ActivityKotlinDocumentBinding
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        binding = ActivityKotlinDocumentBinding.inflate(layoutInflater)
        setContentView(binding.root)

        initData()
    }
    private fun initData() {
        val data = resources.getStringArray(R.array.kotlinDocument).toMutableList()
        binding.recycler.layoutManager = LinearLayoutManager(this,LinearLayoutManager.VERTICAL,false)
        binding.recycler.addItemDecoration(DividerItemDecoration(this,DividerItemDecoration.VERTICAL))
        binding.recycler.adapter = PageJumpAdapter(data)

    }
}